package com.yueya.api.donate;

import com.jfinal.aop.Before;
import com.jfinal.aop.Duang;
import com.jfinal.kit.JsonKit;
import com.yueya.common.action.ApiController;
import com.yueya.common.action.ApiInterceptor;
import com.yueya.common.model.Resp;

import net.sf.json.JSONObject;

@Before(ApiInterceptor.class)
public class IDonateController extends ApiController {

	// 获取知识
	public void getPageDonate() {
		JSONObject jo = this.getJson();
		Resp resp = Duang.duang(IDonateService.class).getPageDonate(jo);
		renderJson(JsonKit.toJson(resp));
	}
	
	// 获取知识
	public void addDonate() {
		JSONObject jo = this.getJson();
		Resp resp = Duang.duang(IDonateService.class).addDonate(jo, this.getUser());
		renderJson(JsonKit.toJson(resp));
	}
	
	// 获取知识
	public void updateDonate() {
		JSONObject jo = this.getJson();
		Resp resp = Duang.duang(IDonateService.class).updateDonate(jo, this.getUser());
		renderJson(JsonKit.toJson(resp));
	}
	
	// 获取知识
	public void deleteDonate() {
		JSONObject jo = this.getJson();
		Resp resp = Duang.duang(IDonateService.class).deleteDonate(jo, this.getUser());
		renderJson(JsonKit.toJson(resp));
	}
	
	// 获取知识
	public void getOneDonate() {
		JSONObject jo = this.getJson();
		Resp resp = Duang.duang(IDonateService.class).getOneDonate(jo);
		renderJson(JsonKit.toJson(resp));
	}
	
}
